package circularQueue;

public class Test {
    public static void main(String[] args) {

        System.out.println("首先使用size方法：");
        MyCircularQueue1 myCircularQueue1 = new MyCircularQueue1(5);
        System.out.println("进行入队操作：");
        myCircularQueue1.enQueue(2);
        myCircularQueue1.enQueue(8);
        myCircularQueue1.enQueue(1998);
        System.out.println("模拟打印：");
        myCircularQueue1.print();
        System.out.println();
        System.out.println("进行出队操作：");
        System.out.println(myCircularQueue1.deQueue());
        System.out.println("模拟打印：");
        myCircularQueue1.print();
        System.out.println();
        System.out.println("获取队头：");
        System.out.println(myCircularQueue1.Front());
        System.out.println("获取队尾：");
        System.out.println(myCircularQueue1.Rear());
        System.out.println("模拟打印：");
        myCircularQueue1.print();
        System.out.println();
        System.out.println("判空：");
        System.out.println(myCircularQueue1.isEmpty());
        System.out.println("判满：");
        System.out.println(myCircularQueue1.isFull());
        System.out.println("输出有效长度：");
        System.out.println(myCircularQueue1.getSize());

        System.out.println();
        System.out.println("===============================");
        System.out.println();

        System.out.println("然后利用浪费空间方法：");
        MyCircularQueue2 myCircularQueue2 = new MyCircularQueue2(5);
        System.out.println("进行入队操作：");
        myCircularQueue2.enQueue(2);
        myCircularQueue2.enQueue(8);
        myCircularQueue2.enQueue(1998);
        System.out.println("模拟打印：");
        myCircularQueue2.print();
        System.out.println();
        System.out.println("进行出队操作：");
        System.out.println(myCircularQueue2.deQueue());
        System.out.println("模拟打印：");
        myCircularQueue2.print();
        System.out.println();
        System.out.println("获取队头：");
        System.out.println(myCircularQueue2.Front());
        System.out.println("获取队尾：");
        System.out.println(myCircularQueue2.Rear());
        System.out.println("模拟打印：");
        myCircularQueue2.print();
        System.out.println();
        System.out.println("判空：");
        System.out.println(myCircularQueue2.isEmpty());
        System.out.println("判满：");
        System.out.println(myCircularQueue2.isFull());

        System.out.println();
        System.out.println("===============================");
        System.out.println();

        System.out.println("最后利用标记方法：");
        MyCircularQueue3 myCircularQueue3 = new MyCircularQueue3(5);
        System.out.println("进行入队操作：");
        myCircularQueue3.enQueue(2);
        myCircularQueue3.enQueue(8);
        myCircularQueue3.enQueue(1998);
        System.out.println("模拟打印：");
        myCircularQueue3.print();
        System.out.println();
        System.out.println("进行出队操作：");
        System.out.println(myCircularQueue3.deQueue());
        System.out.println("模拟打印：");
        myCircularQueue3.print();
        System.out.println();
        System.out.println("获取队头：");
        System.out.println(myCircularQueue3.Front());
        System.out.println("获取队尾：");
        System.out.println(myCircularQueue3.Rear());
        System.out.println("模拟打印：");
        myCircularQueue3.print();
        System.out.println();
        System.out.println("判空：");
        System.out.println(myCircularQueue3.isEmpty());
        System.out.println("判满：");
        System.out.println(myCircularQueue3.isFull());

    }
}
